package com.qf.j2112.controller;

import com.qf.j2112.po.SysGoodsType;
import com.qf.j2112.service.SysGoodsTypeService;
import com.qf.j2112.vo.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@CrossOrigin
public class SysGoodsTypeController {

    @Autowired
    private SysGoodsTypeService sysGoodsTypeService;

    /*查询商品类型表列表*/
    @RequestMapping(value = "/typelist",method = RequestMethod.GET)
    public AjaxResult list() {
        List<SysGoodsType> list = sysGoodsTypeService.selectSysGoodsTypeList();
        return AjaxResult.success("查询成功",list);
    }

    /*获取商品类型表详细信息*/
    @GetMapping(value = "/gettype/{typeId}")
    public AjaxResult getInfo(@PathVariable("typeId") Integer typeId)
    {
        return AjaxResult.success(sysGoodsTypeService.selectSysGoodsTypeByTypeId(typeId));
    }

}
